#include<stdio.h>
#include <unistd.h>
#include<stdlib.h>
int main() 
{

	pid_t id = fork();
	if(id == 0)
	{
		int cnt = 5;
		while(cnt)
		{
			printf("我是一个子进程 pid = %d ppid = %d\n",getpid(),getppid());
			sleep(1);
			cnt--;
		}
		exit(0);
	}


	//printf("Hello world!\n");
	
	//FILE *fp = fopen("log.txt","r");
	//if(fp==NULL)
	//{
	//	return 1;
	//}
	//fclose(fp);
	


	return 0;
}

